from functools import reduce


def move(n, a, b, c):
    if n == 1:
        print(a, '-->', c)
        return
    else:
        move(n - 1, a, c, b)
        move(1, a, b, c)
        move(n - 1, b, c, a)

    return


move(2, 'A', 'B', 'C')

def char2num(s):
    digits = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5,'6': 6, '7': 7, '8': 8, '9': 9}
    return digits[s]


print(char2num('1'))
print(char2num('2'))
print(char2num('3'))
print(char2num('4'))


print(list(map(char2num,'13579')))
